<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags"  prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/search-style.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Search</title>
</head>

<body>
<div id="wrap">
	<div id="banner">
		<%@include file="include/banner.jsp" %>	
	</div>		
	
	<div id="header" >
		<div id = "anchor">
			Search Visitor
		</div>
		<div id = "menu">
			<%@include file="include/menu.jsp" %>	
		</div>	
	</div>
	
	<div id="content">
	
		<s:if test="#session.USER == null">
			<div id ="loginInclude">
				<%@include file="include/login.jsp" %>
			</div>
			
		</s:if>
		<s:elseif test="#session.USER != null">
		<div id = "search" >
		<s:form action="searchLikeFirstName" theme="simple" method="post">
				<s:textfield name = "firstName" placeholder="Enter Visitor's First Name" />
				<s:submit value="Search" cssClass = "submit"></s:submit>	
		</s:form>
		</div>
		<div id="view">
			<table class="gridtable">
				<tr>
					<th width="6%">First name</th>
					<th width="6%">Last name</th>
					<th width="6%">Gender</th>
					<th width="8%">Telephone</th>
					<th width="10%">Email</th>
					<th width="10%">You're in</th>
					<th width="20%">Hobbies</th>
					<th>Description</th>
				</tr>
				<s:if test="vsList.isEmpty()">
					<tr>
						<td align="center" colspan="8" style="background-color: yellow; color: red;"> Not Found! </td>
					</tr>
					</table>
				</s:if>
				<s:else>
					<s:iterator value="vsList">
					<tr>
						<td> <s:property value="firstname"/> </td>
						<td> <s:property value="lastname"/> </td>
						<td> <s:property value="gender"/> </td>
						<td>  <s:property value="telephone"/> </td>
						<td> <s:property value="email"/> </td>
						<td> <s:property value="location"/> </td>
						<td> <s:property value="hobby"/> </td>
						<td> <s:property value="description"/> </td>
					</tr>
					</s:iterator>
					</table>
				</s:else>	
			
		</div>
		</s:elseif>
		
	</div>
	
	<div id="footer">
		<%@include file="include/footer.jsp" %>	
	</div>
	
</div>
</body>
</html>